<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<?php @session_start();
$ax=$_SESSION['aq'];
//echo "$ax";
if($ax<=0){
$eml=$_SESSION['email'];
include_once("sql.php");
$queryx="select * from usertrack where email=\"$eml\"";
if(!mysql_query($queryx)){ die ( 'error:'. mysql_error()); }
$resultx=mysql_query($queryx);
$rowx= mysql_fetch_array($resultx);
$tempq=rand(1,27);
$i=0;

for($j=1;$j<=27;$j++){
if ($rowx[$j]==0){$i=1;break;}
}

	while($rowx[$tempq]!=0 && $i===1){
	//echo "$tempq";
		$tempq=rand(1,27);
	}

if ($i==0){$tempq=400;}	
$queryxx="update login set aq=$tempq where email=\"$eml\"";
if(!mysql_query($queryxx)){ die ( 'error:'. mysql_error()); }
$_SESSION['aq']=$tempq;
}
//echo "not randomizing";
?>
</body>
</html>
